﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using YNTK.Common.Enum;
using YNTK.Common.Filter;
using YNTK.Dependency;
using YNTK.System.Entitys.Dto.Common;

namespace YNTK.System.Entitys.Dto.Permission.Organize
{
    /// <summary>
    /// 查询组织资料请求模型
    /// </summary>
    [SuppressSniffer]
    public class QueryOrganizeDataFilterRequestModel: PageBaseRequestModel
    {
        /// <summary>
        /// 组织资料类型(0.管理手册 1.方针目标 2.法律法规 3.资质荣誉)
        /// </summary>
        [Required(ErrorMessage = "组织资料标识不能为空")]
        public OrganizeDataTypeEnum type { get; set; }

        /// <summary>
        /// 法律法规分类id,法律法规特有
        /// </summary>
        public string classifyId { get; set; } = string.Empty;

        /// <summary>
        /// 创建时间-起
        /// </summary>
        public DateTime? startTime { get; set; } = null;

        /// <summary>
        /// 创建时间-止
        /// </summary>
        public DateTime? endTime { get; set; } = null;

        /// <summary>
        /// 启用/禁用,1.启用 0.禁用 2.全部
        /// </summary>
        public int? enabledMark { get; set; } = null;

        /// <summary>
        /// 模糊查询,标题、来源
        /// </summary>
        /// <example></example>
        public string? keyword { get; set; } = string.Empty;
    }

    /// <summary>
    /// 组织资料(管理手册、方针目标、法律法规、资质荣誉)数据传输模型
    /// </summary>
    [SuppressSniffer]
    public class OrganizeDataListDto
    {
        /// <summary>
        /// id
        /// </summary>
        public string id { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? creatorTime { get; set; }

        /// <summary>
        /// 创建用户id
        /// </summary>
        public string creatorUserId { get; set; }

        /// <summary>
        /// 创建用户姓名
        /// </summary>
        public string creatorUserName { get; set; }

        /// <summary>
        /// 组织资料类型(0.管理手册 1.方针目标 2.法律法规 3.资质荣誉)
        /// </summary>
        public int type { get; set; }

        /// <summary>
        /// 组织资料类型文本
        /// </summary>
        public string typeText { get; set; }

        /// <summary>
        /// 法律法规分类id,法律法规特有
        /// </summary>
        public string classifyId { get; set; }

        /// <summary>
        /// 法律法规分类名称,法律法规特有
        /// </summary>
        public string classifyName { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        public string title { get; set; }

        /// <summary>
        /// 编码,法律法规特有
        /// </summary>
        public string code { get; set; }

        /// <summary>
        /// 发布部门,法律法规特有
        /// </summary>
        public string releaseUnit { get; set; }

        /// <summary>
        /// 实施日期,法律法规特有
        /// </summary>
        public DateTime? materialDate { get; set; }

        /// <summary>
        /// 使用日期,法律法规特有
        /// </summary>
        public DateTime? useDate { get; set; }

        /// <summary>
        /// 适用条款,法律法规特有
        /// </summary>
        public string applicableProvision { get; set; }

        /// <summary>
        /// 适用范围(机构id,多个按逗号分割,机构id不要拼上父级,不选默认全组织),法律法规特有
        /// </summary>
        public string applicableScope { get; set; }

        /// <summary>
        /// 适用范围文本
        /// </summary>
        public string applicableScopeText { get; set; }

        /// <summary>
        /// 来源
        /// </summary>
        public string source { get; set; }

        /// <summary>
        /// 启用/禁用,1.启用
        /// </summary>
        public int? enabledMark { get; set; }

        /// <summary>
        /// 排序码
        /// </summary>
        public long? sortCode { get; set; }
    }

    /// <summary>
    /// 组织资料详细信息传输模型
    /// </summary>
    [SuppressSniffer]
    public class OrganizeDataDto: OrganizeDataListDto
    {
        /// <summary>
        /// 适用范围,拼接上所有父级id,用于编辑时法律法规默认适用范围
        /// </summary>
        public List<string[]> scopeMechanismValue { get; set; }

        /// <summary>
        /// 内容
        /// </summary>
        public string content { get; set; }

        /// <summary>
        /// 档案相关附件数据
        /// </summary>
        public List<FileListDto> fileData { get; set; }
    }

    /// <summary>
    /// 添加组织资料请求模型
    /// </summary>
    [SuppressSniffer]
    public class AddOrganizeDataRequestModel
    {
        /// <summary>
        /// 组织资料类型(0.管理手册 1.方针目标 2.法律法规 3.资质荣誉)
        /// </summary>
        [Required(ErrorMessage = "组织资料标识不能为空")]
        public OrganizeDataTypeEnum type { get; set; }

        /// <summary>
        /// 法律法规分类id,法律法规特有,法律法规必传
        /// </summary>
        public string classifyId { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        [Required(ErrorMessage = "标题不能为空")]
        public string title { get; set; }

        /// <summary>
        /// 编码,法律法规特有
        /// </summary>
        public string code { get; set; }

        /// <summary>
        /// 发布部门,法律法规特有
        /// </summary>
        public string releaseUnit { get; set; }

        /// <summary>
        /// 实施日期,法律法规特有
        /// </summary>
        public DateTime? materialDate { get; set; }

        /// <summary>
        /// 使用日期,法律法规特有
        /// </summary>
        public DateTime? useDate { get; set; }

        /// <summary>
        /// 适用条款,法律法规特有
        /// </summary>
        public string applicableProvision { get; set; }

        /// <summary>
        /// 适用范围(机构id,多个按逗号分割,机构id不要拼上父级,不选默认全组织),法律法规特有
        /// </summary>
        public string applicableScope { get; set; }

        /// <summary>
        /// 来源
        /// </summary>
        public string source { get; set; }

        /// <summary>
        /// 启用/禁用,1.启用
        /// </summary>
        public int? enabledMark { get; set; }

        /// <summary>
        /// 排序码
        /// </summary>
        public long? sortCode { get; set; }

        /// <summary>
        /// 内容
        /// </summary>
        public string content { get; set; }

        /// <summary>
        /// 相关附件数据
        /// </summary>
        public List<FileRequestModel> fileData { get; set; }
    }

    /// <summary>
    /// 修改组织资料请求模型
    /// </summary>
    [SuppressSniffer]
    public class UpdateOrganizeDataRequestModel: AddOrganizeDataRequestModel
    {
        /// <summary>
        /// 组织资料id
        /// </summary>
        [Required(ErrorMessage = "组织资料唯一标识不能为空")]
        public string id { get; set; }
    }

}
